<?php
// +----------------------------------------------------------------------
// | Author: wyd 2025/11/2
// | DESC: 
// +----------------------------------------------------------------------

declare (strict_types=1);

use Swoole\Coroutine;
use function Swoole\Coroutine\run;
// \Co\run()和 Coroutine\run()是一样的，Co是短命称
run(function (){
    //创建协程，通过go,go是create的别名
   go(function (){
       echo "方法1：通过go()方法创建协程,go是create的别名";
   });

   //创建协程，通过Coroutine::create();
   Coroutine::create(function (){
       echo "方法2：通过Coroutine::create()方法创建协程";
   });
});



